03. Introduction
L6 02 Lesson Introduction V1
Download the starter code
To get started, download the Track My Sleep Quality Starter App from GitHub.
Familiarize yourself with the app: Everything provided has been covered in previous lessons. In particular, take a look at the parts of the app that are listed below.
Build and run the app. The app will show the UI for the
SleepTrackerFragment, but no data, and the buttons do not respond to clicks.
Project gradle file
In the project gradle file, notice the variables that specify the versions of the libraries we will be using. The versions used here work well together and with this app.
By the time you take this course, you may be prompted to update gradle or library version. It’s going to be up to you whether you want to do that, or stay with what’s in the app. If you run into "strange" compilation errors, revert to using the same combination of libraries as the solution app.
Module gradle file
- Notice the provided dependencies for all the Android Jetpack libraries, including Room, and the dependencies for coroutines.
Packages and UI
The app is structured by functionality. There is one package for all database code. In the starter app, it contains a placeholder file for defining sleep data.
The
sleepqualityandsleeptrackerpackages contain the provided fragments, and you will add most of your code in those two packages.
Util.kt file
- The
Util.ktfile contains functions to help display sleep quality data. Some code is commented out because it references aViewModel, which you will create later.
androidTest folder/SleepDatabaseTest.kt
- You will be using this provided test to verify that the database is working as intended.
You can download this starter code from GitHub.
Task Description:
Familiarize yourself with the code and assets you will be working with in this lesson.
Task Feedback:
Now you are ready to go!
Reference documentation